var Md5 = require('../../utils/md5.js');
var timeSecond = Math.floor(Date.now() * 0.001);  //获取时间戳: 
var SignInfoData = Md5.hexMD5(timeSecond + 'nativetalk')//md5加密;
var httpFile = 'http://file.waijiaojun.com/';
const app = getApp();
var httpNativetalk = app.globalData.httpNativetalk;
var httpWeike = app.globalData.httpWeike;
Page({
  data: {
    navBar: ['简介', '课表'],
    navComment: ['评价'],
    imgUrl: 'http://file.waijiaojun.com/waijiaojun/icon',
  },
  onLoad:function(e){
    console.log(e)
    wx.request({
      url: httpWeike + '/v4.2/student/find/detail',
      data: {
        weike_id:e.weikeId
      },
      header: {//请求头
        "Timestamp": timeSecond,
        "SignInfo": SignInfoData,
        "content-Type": "application/json",
        "client_type": "3",
        "version": 15,
        "token": '',
      },
      method: 'POST',
      success: function (res) {
        console.log(res.data.obj)
        // var systemClassTypeArrOne = res.data.obj.live_type.slice(0, 5)
        // var systemClassTypeArrTwo = res.data.obj.live_type.slice(5, 10)
        // console.log(systemClassTypeArrOne, systemClassTypeArrTwo)
        // that.setData({
        //   allClassList: res.data.obj.weikeList.data,
        // })
      },
      fail: function (res) { },
      complete: function (res) { },
    })
  },
  navBarFun:function(e){
    console.log(e.currentTarget.dataset.idx)
    var navIdx=e.currentTarget.dataset.idx;
    this.setData({
      navIdx: navIdx,
    })
  },


})